home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news text
| default
| |
99%
| file
| C source text
| default
| |
98%
| file
| C source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 68 75 | 72 73 6c 65 79 2e 69 62 |Path: hu|rsley.ib|
|00000010| 6d 2e 63 6f 6d 21 6e 65 | 77 73 0a 46 72 6f 6d 3a |m.com!ne|ws.From:|
|00000020| 20 4d 61 78 20 57 61 74 | 65 72 6d 61 6e 20 3c 64 | Max Wat|erman <d|
|00000030| 77 61 74 65 72 40 77 69 | 67 68 74 2e 68 75 72 73 |water@wi|ght.hurs|
|00000040| 6c 65 79 2e 69 62 6d 2e | 63 6f 6d 3e 0a 4e 65 77 |ley.ibm.|com>.New|
|00000050| 73 67 72 6f 75 70 73 3a | 20 63 6f 6d 70 2e 6c 61 |sgroups:| comp.la|
|00000060| 6e 67 2e 63 0a 53 75 62 | 6a 65 63 74 3a 20 52 65 |ng.c.Sub|ject: Re|
|00000070| 3a 20 48 45 4c 50 20 3a | 20 41 73 73 69 67 6e 6d |: HELP :| Assignm|
|00000080| 65 6e 74 20 77 69 74 68 | 20 73 74 72 69 6e 67 73 |ent with| strings|
|00000090| 20 61 6e 64 20 70 6f 69 | 6e 74 65 72 73 2e 0a 44 | and poi|nters..D|
|000000a0| 61 74 65 3a 20 57 65 64 | 2c 20 31 30 20 41 70 72 |ate: Wed|, 10 Apr|
|000000b0| 20 31 39 39 36 20 31 32 | 3a 34 38 3a 31 30 20 2b | 1996 12|:48:10 +|
|000000c0| 30 31 30 30 0a 4f 72 67 | 61 6e 69 7a 61 74 69 6f |0100.Org|anizatio|
|000000d0| 6e 3a 20 49 42 4d 20 55 | 4b 20 4c 61 62 6f 72 61 |n: IBM U|K Labora|
|000000e0| 74 6f 72 69 65 73 20 4c | 74 64 2e 0a 4d 65 73 73 |tories L|td..Mess|
|000000f0| 61 67 65 2d 49 44 3a 20 | 3c 33 31 36 42 39 46 46 |age-ID: |<316B9FF|
|00000100| 41 2e 41 42 44 40 77 69 | 67 68 74 2e 68 75 72 73 |A.ABD@wi|ght.hurs|
|00000110| 6c 65 79 2e 69 62 6d 2e | 63 6f 6d 3e 0a 52 65 66 |ley.ibm.|com>.Ref|
|00000120| 65 72 65 6e 63 65 73 3a | 20 3c 33 31 36 61 63 35 |erences:| <316ac5|
|00000130| 62 35 2e 34 32 38 33 36 | 32 32 40 6e 65 77 73 2e |b5.42836|22@news.|
|00000140| 70 6c 61 6e 65 74 2e 6e | 65 74 3e 20 3c 34 6b 65 |planet.n|et> <4ke|
|00000150| 61 69 72 49 4e 4e 33 6a | 76 40 6d 61 79 6e 65 2e |airINN3j|v@mayne.|
|00000160| 75 67 72 61 64 2e 63 73 | 2e 75 62 63 2e 63 61 3e |ugrad.cs|.ubc.ca>|
|00000170| 0a 52 65 70 6c 79 2d 54 | 6f 3a 20 6d 61 78 2d 6c |.Reply-T|o: max-l|
|00000180| 74 6f 6e 40 74 63 70 2e | 63 6f 2e 75 6b 0a 4e 4e |ton@tcp.|co.uk.NN|
|00000190| 54 50 2d 50 6f 73 74 69 | 6e 67 2d 48 6f 73 74 3a |TP-Posti|ng-Host:|
|000001a0| 20 77 69 67 68 74 2e 68 | 75 72 73 6c 65 79 2e 69 | wight.h|ursley.i|
|000001b0| 62 6d 2e 63 6f 6d 0a 4d | 69 6d 65 2d 56 65 72 73 |bm.com.M|ime-Vers|
|000001c0| 69 6f 6e 3a 20 31 2e 30 | 0a 43 6f 6e 74 65 6e 74 |ion: 1.0|.Content|
|000001d0| 2d 54 79 70 65 3a 20 74 | 65 78 74 2f 70 6c 61 69 |-Type: t|ext/plai|
|000001e0| 6e 3b 20 63 68 61 72 73 | 65 74 3d 75 73 2d 61 73 |n; chars|et=us-as|
|000001f0| 63 69 69 0a 43 6f 6e 74 | 65 6e 74 2d 54 72 61 6e |cii.Cont|ent-Tran|
|00000200| 73 66 65 72 2d 45 6e 63 | 6f 64 69 6e 67 3a 20 37 |sfer-Enc|oding: 7|
|00000210| 62 69 74 0a 58 2d 4d 61 | 69 6c 65 72 3a 20 4d 6f |bit.X-Ma|iler: Mo|
|00000220| 7a 69 6c 6c 61 20 32 2e | 30 31 20 28 58 31 31 3b |zilla 2.|01 (X11;|
|00000230| 20 49 3b 20 41 49 58 20 | 32 29 0a 0a 4b 61 7a 69 | I; AIX |2)..Kazi|
|00000240| 6d 69 72 20 4b 79 6c 68 | 65 6b 75 20 77 72 6f 74 |mir Kylh|eku wrot|
|00000250| 65 3a 0a 3e 20 0a 3e 20 | 49 6e 20 61 72 74 69 63 |e:.> .> |In artic|
|00000260| 6c 65 20 3c 33 31 36 61 | 63 35 62 35 2e 34 32 38 |le <316a|c5b5.428|
|00000270| 33 36 32 32 40 6e 65 77 | 73 2e 70 6c 61 6e 65 74 |3622@new|s.planet|
|00000280| 2e 6e 65 74 3e 2c 0a 3e | 20 44 61 76 69 64 20 20 |.net>,.>| David |
|00000290| 3c 63 79 67 6e 75 73 78 | 40 70 6c 61 6e 65 74 2e |<cygnusx|@planet.|
|000002a0| 6e 65 74 3e 20 77 72 6f | 74 65 3a 0a 3e 20 3e 0a |net> wro|te:.> >.|
|000002b0| 3e 20 3e 0a 3e 20 3e 54 | 68 69 73 20 70 72 6f 67 |> >.> >T|his prog|
|000002c0| 72 61 6d 20 69 73 20 70 | 72 6f 62 61 62 6c 79 20 |ram is p|robably |
|000002d0| 69 64 69 6f 74 69 63 20 | 73 69 6e 63 65 20 49 20 |idiotic |since I |
|000002e0| 61 6d 20 69 6e 20 61 20 | 28 69 6e 74 72 6f 20 74 |am in a |(intro t|
|000002f0| 6f 20 43 20 29 20 63 6c | 61 73 73 0a 3e 20 3e 62 |o C ) cl|ass.> >b|
|00000300| 75 74 20 69 74 20 64 6f | 65 73 20 77 6f 72 6b 2e |ut it do|es work.|
|00000310| 20 49 20 77 61 73 20 77 | 6f 6e 64 65 72 69 6e 67 | I was w|ondering|
|00000320| 20 69 66 20 61 6e 79 6f | 6e 65 20 68 61 64 20 61 | if anyo|ne had a|
|00000330| 20 62 65 74 74 65 72 20 | 69 64 65 61 20 66 6f 72 | better |idea for|
|00000340| 20 74 68 69 73 0a 3e 20 | 3e 74 79 70 65 20 6f 66 | this.> |>type of|
|00000350| 20 73 69 74 75 61 74 69 | 6f 6e 2e 20 49 20 63 6f | situati|on. I co|
|00000360| 75 6c 64 20 6e 6f 74 20 | 66 69 6e 64 20 61 6e 20 |uld not |find an |
|00000370| 61 63 74 75 61 6c 20 66 | 75 6e 63 74 69 6f 6e 20 |actual f|unction |
|00000380| 69 6e 20 74 68 65 0a 3e | 20 3e 63 68 61 72 61 63 |in the.>| >charac|
|00000390| 74 65 72 20 68 61 6e 64 | 6c 69 6e 67 20 6c 69 62 |ter hand|ling lib|
|000003a0| 72 61 72 79 20 66 6f 72 | 20 74 68 69 73 3f 20 64 |rary for| this? d|
|000003b0| 6f 65 73 20 6f 6e 65 20 | 65 78 69 73 74 20 3f 20 |oes one |exist ? |
|000003c0| 69 20 77 6f 75 6c 64 20 | 6c 69 6b 65 20 74 6f 0a |i would |like to.|
|000003d0| 3e 20 3e 6d 61 6b 65 20 | 61 20 73 65 70 61 72 61 |> >make |a separa|
|000003e0| 74 65 20 66 75 6e 63 74 | 69 6f 6e 20 69 6e 20 74 |te funct|ion in t|
|000003f0| 68 65 20 6d 61 69 6e 20 | 74 6f 20 68 61 6e 64 6c |he main |to handl|
|00000400| 65 20 74 68 69 73 20 74 | 61 73 6b 3f 20 49 73 20 |e this t|ask? Is |
|00000410| 69 74 0a 3e 20 3e 70 6f | 73 73 69 62 6c 65 3f 0a |it.> >po|ssible?.|
|00000420| 3e 20 3e 0a 3e 20 3e 74 | 68 61 6e 78 20 44 61 76 |> >.> >t|hanx Dav|
|00000430| 69 64 0a 3e 20 3e 0a 3e | 20 3e 0a 3e 20 3e 20 20 |id.> >.>| >.> > |
|00000440| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 64 69 6f 2e |#include| <stdio.|
|00000450| 68 3e 0a 3e 20 3e 20 20 | 23 69 6e 63 6c 75 64 65 |h>.> > |#include|
|00000460| 20 3c 63 74 79 70 65 2e | 68 3e 0a 3e 20 3e 0a 3e | <ctype.|h>.> >.>|
|00000470| 20 3e 20 20 20 2f 2a 20 | 74 68 69 73 20 70 72 6f | > /* |this pro|
|00000480| 67 72 61 6d 20 64 65 74 | 65 72 6d 69 6e 65 73 20 |gram det|ermines |
|00000490| 69 66 20 74 68 65 20 66 | 69 72 73 74 20 77 6f 72 |if the f|irst wor|
|000004a0| 64 20 20 69 73 20 74 68 | 65 20 73 65 63 6f 6e 64 |d is th|e second|
|000004b0| 20 77 6f 72 64 0a 3e 20 | 3e 73 70 65 6c 6c 65 64 | word.> |>spelled|
|000004c0| 20 62 61 63 6b 77 6f 72 | 64 73 20 61 6e 64 20 68 | backwor|ds and h|
|000004d0| 61 76 65 20 6f 6e 6c 79 | 20 69 6e 63 6c 75 64 65 |ave only| include|
|000004e0| 64 20 33 20 63 68 61 72 | 61 63 74 65 72 73 20 66 |d 3 char|acters f|
|000004f0| 6f 72 0a 3e 20 3e 73 69 | 6d 70 6c 69 66 69 63 61 |or.> >si|mplifica|
|00000500| 74 69 6f 6e 20 2e 20 69 | 6e 70 75 74 73 20 68 61 |tion . i|nputs ha|
|00000510| 76 65 20 62 65 65 6e 20 | 6c 65 66 74 20 6f 75 74 |ve been |left out|
|00000520| 20 66 6f 72 20 63 6c 61 | 72 69 74 79 20 2a 2f 0a | for cla|rity */.|
|00000530| 3e 20 0a 3e 20 59 6f 75 | 20 68 61 76 65 20 74 6f |> .> You| have to|
|00000540| 20 75 73 65 20 6c 6f 6f | 70 73 20 74 6f 20 69 74 | use loo|ps to it|
|00000550| 65 72 61 74 65 20 6f 76 | 65 72 20 74 68 65 20 63 |erate ov|er the c|
|00000560| 68 61 72 61 63 74 65 72 | 73 20 6f 66 20 74 77 6f |haracter|s of two|
|00000570| 20 73 74 72 69 6e 67 73 | 0a 3e 20 73 69 6d 75 6c | strings|.> simul|
|00000580| 74 61 6e 65 6f 75 73 6c | 79 2c 20 66 6f 72 77 61 |taneousl|y, forwa|
|00000590| 72 64 20 6f 76 65 72 20 | 6f 6e 65 20 61 6e 64 20 |rd over |one and |
|000005a0| 62 61 63 6b 77 61 72 64 | 20 6f 76 65 72 20 74 68 |backward| over th|
|000005b0| 65 20 6f 74 68 65 72 2e | 20 49 6e 20 6f 74 68 65 |e other.| In othe|
|000005c0| 72 20 77 6f 72 64 73 2c | 0a 3e 20 67 65 6e 65 72 |r words,|.> gener|
|000005d0| 61 6c 69 7a 65 20 74 68 | 65 20 74 65 73 74 20 79 |alize th|e test y|
|000005e0| 6f 75 20 68 61 76 65 20 | 68 61 6e 64 2d 63 6f 64 |ou have |hand-cod|
|000005f0| 65 64 20 66 6f 72 20 74 | 68 65 20 73 70 65 63 69 |ed for t|he speci|
|00000600| 61 6c 20 63 61 73 65 20 | 6f 66 20 74 68 72 65 65 |al case |of three|
|00000610| 20 63 68 61 72 61 63 74 | 65 72 0a 3e 20 73 74 72 | charact|er.> str|
|00000620| 69 6e 67 73 2e 0a 3e 20 | 0a 3e 20 46 69 72 73 74 |ings..> |.> First|
|00000630| 20 79 6f 75 20 74 72 69 | 76 69 61 6c 6c 79 20 72 | you tri|vially r|
|00000640| 65 6a 65 63 74 20 74 68 | 65 20 63 61 73 65 20 77 |eject th|e case w|
|00000650| 68 65 6e 20 74 68 65 20 | 73 74 72 69 6e 67 73 20 |hen the |strings |
|00000660| 68 61 76 65 20 61 20 64 | 69 66 66 65 72 65 6e 74 |have a d|ifferent|
|00000670| 20 6c 65 6e 67 74 68 0a | 3e 20 28 6f 72 20 61 6c | length.|> (or al|
|00000680| 74 65 72 6e 61 74 65 6c | 79 20 70 65 72 66 6f 72 |ternatel|y perfor|
|00000690| 6d 20 74 68 65 20 63 6f | 6d 70 61 72 69 73 6f 6e |m the co|mparison|
|000006a0| 20 6f 6e 20 74 68 65 20 | 66 69 72 73 74 20 4e 20 | on the |first N |
|000006b0| 63 68 61 72 61 63 74 65 | 72 73 20 6f 66 20 62 6f |characte|rs of bo|
|000006c0| 74 68 0a 3e 20 73 74 72 | 69 6e 67 73 2c 20 77 68 |th.> str|ings, wh|
|000006d0| 65 72 65 20 4e 20 69 73 | 20 74 68 65 20 6c 65 73 |ere N is| the les|
|000006e0| 73 65 72 20 6f 66 20 74 | 68 65 69 72 20 74 77 6f |ser of t|heir two|
|000006f0| 20 6c 65 6e 67 74 68 73 | 29 2e 0a 0a 49 20 77 6f | lengths|)...I wo|
|00000700| 75 6c 64 20 69 6d 70 6c | 65 6d 65 6e 74 20 74 68 |uld impl|ement th|
|00000710| 69 73 20 73 6c 69 67 68 | 74 6c 79 2c 20 62 65 63 |is sligh|tly, bec|
|00000720| 61 75 73 65 20 49 20 64 | 6f 6e 27 74 20 6c 69 6b |ause I d|on't lik|
|00000730| 65 20 6d 75 6c 74 69 70 | 6c 65 20 65 78 69 74 20 |e multip|le exit |
|00000740| 70 6f 69 6e 74 73 20 28 | 6e 62 20 49 20 66 6f 6c |points (|nb I fol|
|00000750| 6c 6f 77 0a 64 69 66 66 | 65 72 65 6e 74 20 63 6f |low.diff|erent co|
|00000760| 64 69 6e 67 20 73 74 61 | 6e 64 61 72 64 73 20 74 |ding sta|ndards t|
|00000770| 6f 20 74 68 65 20 65 78 | 61 6d 70 6c 65 20 67 69 |o the ex|ample gi|
|00000780| 76 65 6e 29 3a 2d 0a 0a | 23 69 6e 63 6c 75 64 65 |ven):-..|#include|
|00000790| 20 3c 73 74 64 69 6f 2e | 68 3e 0a 23 69 6e 63 6c | <stdio.|h>.#incl|
|000007a0| 75 64 65 20 3c 73 74 72 | 69 6e 67 2e 68 3e 0a 0a |ude <str|ing.h>..|
|000007b0| 2f 2a 20 74 68 69 73 20 | 6c 6f 74 20 77 6f 75 6c |/* this |lot woul|
|000007c0| 64 20 6e 6f 72 6d 61 6c | 6c 79 20 67 6f 20 69 6e |d normal|ly go in|
|000007d0| 20 61 20 73 65 70 61 72 | 61 74 65 20 66 69 6c 65 | a separ|ate file|
|000007e0| 20 2a 2f 0a 23 69 66 64 | 65 66 20 54 52 55 45 0a | */.#ifd|ef TRUE.|
|000007f0| 23 75 6e 64 65 66 20 54 | 52 55 45 0a 23 65 6e 64 |#undef T|RUE.#end|
|00000800| 69 66 0a 0a 23 69 66 64 | 65 66 20 46 41 4c 53 45 |if..#ifd|ef FALSE|
|00000810| 0a 23 75 6e 64 65 66 20 | 46 41 4c 53 45 0a 23 65 |.#undef |FALSE.#e|
|00000820| 6e 64 69 66 0a 0a 65 6e | 75 6d 20 42 6f 6f 6c 20 |ndif..en|um Bool |
|00000830| 7b 20 46 41 4c 53 45 2c | 20 54 52 55 45 20 7d 3b |{ FALSE,| TRUE };|
|00000840| 0a 74 79 70 65 64 65 66 | 20 65 6e 75 6d 20 42 6f |.typedef| enum Bo|
|00000850| 6f 6c 20 42 6f 6f 6c 3b | 0a 74 79 70 65 64 65 66 |ol Bool;|.typedef|
|00000860| 20 63 68 61 72 20 2a 43 | 68 61 72 5f 50 74 72 3b | char *C|har_Ptr;|
|00000870| 0a 74 79 70 65 64 65 66 | 20 73 69 7a 65 5f 74 20 |.typedef| size_t |
|00000880| 53 69 7a 65 5f 54 3b 0a | 74 79 70 65 64 65 66 20 |Size_T;.|typedef |
|00000890| 69 6e 74 20 49 6e 74 3b | 0a 2f 2a 20 73 6f 20 74 |int Int;|./* so t|
|000008a0| 68 61 74 20 69 74 27 73 | 20 65 61 73 69 65 72 20 |hat it's| easier |
|000008b0| 74 6f 20 63 68 61 6e 67 | 65 20 77 68 65 6e 20 70 |to chang|e when p|
|000008c0| 6f 72 74 65 64 20 74 6f | 20 64 69 66 66 65 72 65 |orted to| differe|
|000008d0| 6e 74 20 61 72 63 68 69 | 74 65 63 74 75 72 65 73 |nt archi|tectures|
|000008e0| 20 2a 2f 0a 2f 2a 20 6e | 6f 74 20 72 65 61 6c 6c | */./* n|ot reall|
|000008f0| 79 20 6e 65 63 65 73 73 | 61 72 79 20 2a 2f 0a 0a |y necess|ary */..|
|00000900| 42 6f 6f 6c 20 72 65 76 | 65 72 73 65 63 6d 70 28 |Bool rev|ersecmp(|
|00000910| 20 63 6f 6e 73 74 20 43 | 68 61 72 5f 50 74 72 20 | const C|har_Ptr |
|00000920| 73 31 2c 20 63 6f 6e 73 | 74 20 43 68 61 72 5f 50 |s1, cons|t Char_P|
|00000930| 74 72 20 73 32 20 29 0a | 7b 0a 20 20 42 6f 6f 6c |tr s2 ).|{. Bool|
|00000940| 20 73 74 72 69 6e 67 73 | 5f 61 72 65 5f 73 61 6d | strings|_are_sam|
|00000950| 65 5f 62 61 63 6b 77 61 | 72 64 73 20 3d 20 54 52 |e_backwa|rds = TR|
|00000960| 55 45 3b 0a 20 20 42 6f | 6f 6c 20 66 69 6e 69 73 |UE;. Bo|ol finis|
|00000970| 68 65 64 5f 63 68 65 63 | 6b 69 6e 67 20 3d 20 46 |hed_chec|king = F|
|00000980| 41 4c 53 45 3b 0a 20 20 | 53 69 7a 65 5f 54 20 6c |ALSE;. |Size_T l|
|00000990| 65 6e 67 74 68 5f 6f 66 | 5f 73 31 20 3d 20 73 74 |ength_of|_s1 = st|
|000009a0| 72 6c 65 6e 28 20 73 31 | 20 29 3b 0a 20 20 53 69 |rlen( s1| );. Si|
|000009b0| 7a 65 5f 54 20 6c 65 6e | 67 74 68 5f 6f 66 5f 73 |ze_T len|gth_of_s|
|000009c0| 32 20 3d 20 73 74 72 6c | 65 6e 28 20 73 32 20 29 |2 = strl|en( s2 )|
|000009d0| 3b 0a 0a 20 20 49 6e 74 | 20 73 31 5f 69 6e 64 65 |;.. Int| s1_inde|
|000009e0| 78 3d 30 0a 0a 20 20 69 | 66 20 28 20 6c 65 6e 67 |x=0.. i|f ( leng|
|000009f0| 74 68 5f 6f 66 5f 73 31 | 20 21 3d 20 6c 65 6e 67 |th_of_s1| != leng|
|00000a00| 74 68 5f 6f 66 5f 73 32 | 20 29 20 7b 0a 20 20 20 |th_of_s2| ) {. |
|00000a10| 20 73 74 72 69 6e 67 73 | 5f 61 72 65 5f 73 61 6d | strings|_are_sam|
|00000a20| 65 5f 62 61 63 6b 77 61 | 72 64 73 20 3d 20 46 41 |e_backwa|rds = FA|
|00000a30| 4c 53 45 3b 0a 20 20 20 | 20 66 69 6e 69 73 68 65 |LSE;. | finishe|
|00000a40| 64 5f 63 68 65 63 6b 69 | 6e 67 20 3d 20 54 52 55 |d_checki|ng = TRU|
|00000a50| 45 3b 0a 20 20 7d 0a 0a | 20 20 77 68 69 6c 65 20 |E;. }..| while |
|00000a60| 28 20 21 66 69 6e 69 73 | 68 65 64 5f 63 68 65 63 |( !finis|hed_chec|
|00000a70| 6b 69 6e 67 20 29 20 7b | 0a 20 20 20 20 49 6e 74 |king ) {|. Int|
|00000a80| 20 73 32 5f 69 6e 64 65 | 78 20 3d 20 6c 65 6e 67 | s2_inde|x = leng|
|00000a90| 74 68 5f 6f 66 5f 73 32 | 20 2d 20 73 31 5f 69 6e |th_of_s2| - s1_in|
|00000aa0| 64 65 78 3b 0a 20 20 20 | 20 73 74 72 69 6e 67 73 |dex;. | strings|
|00000ab0| 5f 61 72 65 5f 73 61 6d | 65 5f 62 61 63 6b 77 61 |_are_sam|e_backwa|
|00000ac0| 72 64 73 20 3d 20 28 20 | 73 31 5b 73 31 5f 69 6e |rds = ( |s1[s1_in|
|00000ad0| 64 65 78 5d 20 3d 3d 20 | 73 32 5b 73 32 5f 69 6e |dex] == |s2[s2_in|
|00000ae0| 64 65 78 5d 20 29 3b 0a | 20 20 20 20 66 69 6e 69 |dex] );.| fini|
|00000af0| 73 68 65 64 5f 63 68 65 | 63 6b 69 6e 67 20 3d 20 |shed_che|cking = |
|00000b00| 21 73 74 72 69 6e 67 73 | 5f 61 72 65 5f 73 61 6d |!strings|_are_sam|
|00000b10| 65 5f 62 61 63 6b 77 61 | 72 64 73 20 7c 20 7c 28 |e_backwa|rds | |(|
|00000b20| 20 73 31 5f 69 6e 64 65 | 78 20 3e 3d 20 6c 65 6e | s1_inde|x >= len|
|00000b30| 67 74 68 5f 6f 66 5f 73 | 31 20 29 3b 0a 0a 20 20 |gth_of_s|1 );.. |
|00000b40| 20 20 73 31 5f 69 6e 64 | 65 78 2b 2b 3b 0a 20 20 | s1_ind|ex++;. |
|00000b50| 7d 0a 0a 20 20 72 65 74 | 75 72 6e 20 73 74 72 69 |}.. ret|urn stri|
|00000b60| 6e 67 73 5f 61 72 65 5f | 73 61 6d 65 5f 62 61 63 |ngs_are_|same_bac|
|00000b70| 6b 77 61 72 64 73 3b 0a | 7d 0a 0a 4e 6f 74 20 61 |kwards;.|}..Not a|
|00000b80| 6c 6f 74 20 6f 66 20 64 | 69 66 66 65 72 65 6e 63 |lot of d|ifferenc|
|00000b90| 65 2c 20 74 68 6f 75 67 | 68 2e 20 42 75 74 20 49 |e, thoug|h. But I|
|00000ba0| 27 6c 6c 20 62 65 74 20 | 49 20 67 65 74 20 66 6c |'ll bet |I get fl|
|00000bb0| 61 6d 65 64 20 66 6f 72 | 20 74 68 69 73 20 2d 20 |amed for| this - |
|00000bc0| 49 20 68 61 76 65 6e 27 | 74 20 63 68 65 63 6b 65 |I haven'|t checke|
|00000bd0| 64 20 69 74 0a 2d 20 61 | 6e 64 20 70 65 6f 70 6c |d it.- a|nd peopl|
|00000be0| 65 20 75 73 75 61 6c 6c | 79 20 67 65 74 20 66 6c |e usuall|y get fl|
|00000bf0| 61 6d 65 64 20 69 6e 20 | 74 68 69 73 20 67 72 6f |amed in |this gro|
|00000c00| 75 70 2c 20 6e 6f 20 6d | 61 74 74 65 72 20 77 68 |up, no m|atter wh|
|00000c10| 61 74 20 74 68 65 79 20 | 73 61 79 2e 20 49 74 27 |at they |say. It'|
|00000c20| 73 20 71 75 69 74 65 0a | 75 6e 73 6f 63 69 61 62 |s quite.|unsociab|
|00000c30| 6c 65 20 6c 69 6b 65 20 | 74 68 61 74 2e 0a 0a 3e |le like |that...>|
|00000c40| 20 0a 3e 20 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 | .> #inc|lude <st|
|00000c50| 64 69 6f 2e 68 3e 0a 3e | 20 23 69 6e 63 6c 75 64 |dio.h>.>| #includ|
|00000c60| 65 20 3c 73 74 72 69 6e | 67 2e 68 3e 0a 3e 20 0a |e <strin|g.h>.> .|
|00000c70| 3e 20 69 6e 74 20 72 65 | 76 65 72 73 65 63 6d 70 |> int re|versecmp|
|00000c80| 28 63 6f 6e 73 74 20 63 | 68 61 72 20 2a 73 31 2c |(const c|har *s1,|
|00000c90| 20 63 6f 6e 73 74 20 63 | 68 61 72 20 2a 73 32 29 | const c|har *s2)|
|00000ca0| 0a 3e 20 7b 0a 3e 20 20 | 20 20 20 20 20 20 20 73 |.> {.> | s|
|00000cb0| 69 7a 65 5f 74 20 4c 31 | 20 3d 20 73 74 72 6c 65 |ize_t L1| = strle|
|00000cc0| 6e 28 73 31 29 3b 0a 3e | 20 20 20 20 20 20 20 20 |n(s1);.>| |
|00000cd0| 20 73 69 7a 65 5f 74 20 | 4c 32 20 3d 20 73 74 72 | size_t |L2 = str|
|00000ce0| 6c 65 6e 28 73 32 29 3b | 0a 3e 20 20 20 20 20 20 |len(s2);|.> |
|00000cf0| 20 20 20 73 69 7a 65 5f | 74 20 69 2c 20 6a 3b 0a | size_|t i, j;.|
|00000d00| 3e 20 0a 3e 20 20 20 20 | 20 20 20 20 20 69 66 20 |> .> | if |
|00000d10| 28 4c 31 20 21 3d 20 4c | 32 29 0a 3e 20 20 20 20 |(L1 != L|2).> |
|00000d20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 72 65 74 | | ret|
|00000d30| 75 72 6e 20 30 3b 0a 3e | 20 0a 3e 20 20 20 20 20 |urn 0;.>| .> |
|00000d40| 20 20 20 20 66 6f 72 20 | 28 69 20 3d 20 30 2c 20 | for |(i = 0, |
|00000d50| 6a 20 3d 20 4c 32 2d 31 | 3b 20 69 20 3c 20 4c 31 |j = L2-1|; i < L1|
|00000d60| 3b 20 69 2b 2b 2c 20 6a | 2d 2d 29 0a 3e 20 20 20 |; i++, j|--).> |
|00000d70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 69 66 | | if|
|00000d80| 20 28 73 31 5b 69 5d 20 | 21 3d 20 73 32 5b 6a 5d | (s1[i] |!= s2[j]|
|00000d90| 29 0a 3e 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |).> | |
|00000da0| 20 20 20 20 20 20 20 20 | 20 20 20 20 72 65 74 75 | | retu|
|00000db0| 72 6e 20 30 3b 0a 3e 20 | 0a 3e 20 20 20 20 20 20 |rn 0;.> |.> |
|00000dc0| 20 20 20 72 65 74 75 72 | 6e 20 31 3b 0a 3e 20 7d | retur|n 1;.> }|
|00000dd0| 0a 3e 20 2d 2d 0a 0a 2d | 2d 20 0a 20 20 20 20 5f |.> --..-|- . _|
|00000de0| 5f 5f 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |__ | |
|00000df0| 20 20 20 20 20 20 20 20 | 6d 61 69 6c 74 6f 3a 6d | |mailto:m|
|00000e00| 61 78 2d 6c 74 6f 6e 40 | 74 63 70 2e 63 6f 2e 75 |ax-lton@|tcp.co.u|
|00000e10| 6b 20 0a 20 20 2f 20 20 | 2f 20 20 2f 20 20 5f 20 |k . / |/ / _ |
|00000e20| 20 20 20 20 20 20 2f 20 | 20 20 20 20 2f 20 20 5f | / | / _|
|00000e30| 20 20 5f 5f 20 5f 5f 20 | 20 20 5f 20 20 20 5f 5f | __ __ | _ __|
|00000e40| 20 20 20 5f 0a 20 2f 20 | 20 2f 20 20 2f 20 2f 5f | _. / | / / /_|
|00000e50| 2f 20 7c 2f 20 20 2f 20 | 20 2f 20 20 2f 20 2f 5f |/ |/ / | / / /_|
|00000e60| 2f 20 20 2f 20 20 2f 5f | 20 20 20 2f 5f 2f 20 2f |/ / /_| /_/ /|
|00000e70| 20 2f 20 2f 20 2f 5f 2f | 20 2f 7c 20 2f 0a 2f 20 | / / /_/| /| /./ |
|00000e80| 20 2f 20 20 2f 20 2f 20 | 20 2f 20 2f 7c 20 20 2f | / / / | / /| /|
|00000e90| 5f 2f 5f 2f 20 2f 20 20 | 2f 20 20 2f 20 20 2f 5f |_/_/ / |/ / /_|
|00000ea0| 20 20 2f 20 20 7c 20 20 | 2f 20 2f 20 2f 20 2f 20 | / | |/ / / / |
|00000eb0| 20 2f 20 2f 20 7c 2f 0a | | / / |/.| |
+--------+-------------------------+-------------------------+--------+--------+